package org.example.myerp.controller;


import org.example.myerp.mapper.dto.MaterialCompositionDesignReview;
import org.example.myerp.mapper.dto.MaterialInformationDto;
import org.example.myerp.pojo.PageMyself;
import org.example.myerp.service.ProWuliaoTabService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * ��Ʒ������ɱ����Ʋ㡿
 * @author DELL
 *
 */
//@CrossOrigin(methods = { RequestMethod.POST, RequestMethod.GET }, allowCredentials = "true", allowedHeaders = "*")

@RestController
@RequestMapping("/design/ProWuliaoTab")
public class ProWuliaoTabController {
	@Autowired
    ProWuliaoTabService proWuliaoTabService;


	@RequestMapping("/insertProductMaterialComposition")
	@ResponseBody
	public Integer insertProductMaterialComposition(MaterialInformationDto materialInformationDto){
		Integer row = proWuliaoTabService.getInsertMaterialCompositionMessage(materialInformationDto);
		return row;
	}

	/**
	 * ��ѯ���������Ƶ�δ��˵�ȫ����Ϣ����ҳ��ѯ��
	 * @param pageNum
	 * @param pageSize
	 * @return
	 */
	@RequestMapping("/selectAllMaterialCompositionDesignReviewByReviewSign")
	@ResponseBody
	public PageMyself<MaterialCompositionDesignReview> selectAllMaterialCompositionDesignReviewByReviewSign(Integer pageNum, Integer pageSize) {
		PageMyself<MaterialCompositionDesignReview> page = proWuliaoTabService.getSelectAllMaterialCompositionDesignReviewByReviewSign((pageNum-1)*pageSize, pageSize);
		return page;
	}


	@RequestMapping("/updateProWuliaoTabAllAndDetaile")
	@ResponseBody
	public Integer updateProWuliaoTabAllAndDetaile(MaterialInformationDto materialInformationDto){
		Integer row = proWuliaoTabService.getUpdateProWuliaoTabRealReviewSign(materialInformationDto);
		return row;
	}
}
